package yunmouren.top.place;

import journeymap.client.api.IClientAPI;
import journeymap.client.api.IClientPlugin;
import journeymap.client.api.display.Waypoint;
import journeymap.client.api.event.ClientEvent;
import net.minecraft.util.math.BlockPos;
import net.minecraftforge.common.MinecraftForge;

import javax.annotation.ParametersAreNonnullByDefault;

/**
 * The @journeymap.client.api.ClientPlugin annotation makes this plugin class discoverable to JourneyMap,
 * which will create an instance of it and then call initialize on it.
 */
@ParametersAreNonnullByDefault
@journeymap.client.api.ClientPlugin
public class JourneyMapApi implements IClientPlugin {
    public static IClientAPI api;

    public void initialize(IClientAPI iClientAPI) {
        api = iClientAPI;
        MinecraftForge.EVENT_BUS.register(this);
    }

    public String getModId() {
        return Place.MOD_ID;
    }

    public void onEvent(ClientEvent clientEvent) {

    }
    public static void show(String name, int dim, BlockPos BlockPos) throws Exception {
        api.show(new Waypoint(Place.MOD_ID, name, dim, BlockPos));
    }
}
